package com.ksd.pug.controller.article;

import com.ksd.pug.controller.APIBaseController;
import com.ksd.pug.pojo.Article;
import com.ksd.pug.pojo.ArticleUserCollect;
import com.ksd.pug.service.article.IArticleService;
import com.ksd.pug.service.article.IArticleUserCollectService;
import com.ksd.pug.vo.comment.ArticleVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author: hcl
 * @date: 2022/1/24 15:05
 * @Description:
 */
@RestController
@Slf4j
public class ArticleUserCollectController extends APIBaseController {

    @Resource
    private IArticleUserCollectService articleUserCollectService;

    @Autowired
    private IArticleService articleService;

    //查询用户收藏
    @PostMapping("/article/getlist")
    public List<ArticleUserCollect> getCollect(){
        return articleUserCollectService.userCollectList();
    }

    //查询自己的文章
    @PostMapping("/article/listmy")
    public List<Article> findArticleMy(@RequestBody ArticleVo articleVo) {
        return articleService.findArticleMy(articleVo);
    }
}
